<!doctype html>
<html lang="en">
<head>
<!-- <meta http-equiv="refresh" content="20"> -->
<title>Map Demo</title>
<script src="/statics/lib/OpenLayers.js" type="text/javascript"></script>
<link rel="stylesheet" href="/statics/theme/default/style.css"
	type="text/css">
<style>
.map {
	height: 400px;
	width: 100%;
}
</style>
<script type="text/javascript">
	OpenLayers.ProxyHost = "proxy.cgi?url=";
	var map;
	var AirLine;
	var ChinaBas;
	var Airport; 
	function load() {
		map = new OpenLayers.Map({
			div : "map",
			maxExtent : new OpenLayers.Bounds(73.487345, 3.832361, 135.087387, 53.561602)
					
		});
		ChinaBase = new OpenLayers.Layer.WMS("China Admin",
	            "http://10.70.94.96:8080/geoserver/wms", 
	            {'layers': 'GisTest:chn_adm1', transparent: true, format: 'image/gif'},
	            {isBaseLayer: true}
	        );  
		
		Airport = new OpenLayers.Layer.WMS("China Admin",
	            "http://10.70.94.96:8080/geoserver/wms", 
	            {'layers': 'GisTest:airportinfo', transparent: true, format: 'image/gif'},
	            {isBaseLayer: false}
	        ); 

		AirLine = new OpenLayers.Layer.WMS("China Admin",
	            "http://10.70.94.96:8080/geoserver/wms", 
	            {'layers': 'GisTest:planlineinfo', transparent: true, format: 'image/gif'},
	            {isBaseLayer: false}
	        ); 
		map.addLayers([ChinaBase, Airport, AirLine]); 
//		map.addControl(new OpenLayers.Control.LayerSwitcher());
 		map.zoomToMaxExtent();
		
	}
	
	function refresh(){
		map.removeLayer(AirLine);
		AirLine = new OpenLayers.Layer.WMS("China Admin",
	            "http://10.70.94.96:8080/geoserver/wms", 
	            {'layers': 'GisTest:planlineinfo', transparent: true, format: 'image/gif'},
	            {isBaseLayer: false}
	        );
		map.addLayers([ChinaBase, Airport, AirLine]); 
	}
</script>
</head>
<body onload="load()">
	<h2>My Map</h2>
	<div id="map" class="map"></div>
	<button onclick="refresh()" >刷新</button>
	<p>Open Layer Display China Map Demo.</p>
</body>
</html>